/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.page;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *@ClassName: PageBean
 *@Description: 分页Bean
 *@author youjun
 *@date 2017年5月25日 下午8:40:11
 */
public class PageBean<T> implements Serializable {
	
	/**serialVersionUID*/
	private static final long serialVersionUID = 1L;

	/**The data set*/
	private List<T> dataList;
	
	/**current page num*/
	private int pageNo = 1;
	
	/**Number each page shows article*/
	private int pageSize = 20;
	
	/**The total number of article*/
	private long total;
	
	/**Total number of pages*/
	private int pages;

	public PageBean(){
		
	}
	
	public PageBean(int pageNo){
		this.pageNo = pageNo;
	}
	
	public PageBean(Integer pageNo, Integer pageSize){
		if(pageNo!=null) {
			this.pageNo = pageNo;
		}
		if(pageSize!=null) {
			this.pageSize = pageSize;
		}
	}
	
	public List<T> getDataList() {
		if(dataList==null) {
			return new ArrayList<T>();
		}
		return dataList;
	}

	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getPages() {
		return pages;
	}

	public void setPages(int pages) {
		this.pages = pages;
	}
	
}
